﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BookingManagementSystem.Models;

namespace BookingManagementSystem.Controllers
{
    public class CalendarController: Controller
    {
        public ActionResult Index()
        {
            return View();
        }


        
        public ActionResult GetEvents(int start, int end)
        {
            var from = Tools.UnixTimeStampToDateTime(start);
            var to = Tools.UnixTimeStampToDateTime(end);
            var bookings = BookingManagementSystem.Models.EventDataAccess.GetBookingsByRange(from, to);
            return Json(bookings, JsonRequestBehavior.AllowGet);
        }

    }
}